home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Networking / SNMP / SNMP Development / MacSNMP Developer 1.0.2 / Sample Agent / Sources / SampleAgent.r < prev    next >
Encoding:
Text File  |  1993-06-15  |  5.5 KB  |  146 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SampleAgent.r
  3.  
  4.     Contains:    Resources for the SampleAgent Library
  5.  
  6.     Copyright:    © 1991-1992 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. #ifndef __TYPES.R__
  11. #include "Types.r"
  12. #endif
  13.  
  14. #include "SNMPVersionResource.r"
  15.  
  16. #ifndef __SNMPTypes.r__
  17. #include "SNMPTypes.r"
  18. #endif
  19.  
  20. INCLUDE "SampleAgent.RSRC" 'libr' (0) as 'libr' (0);
  21. INCLUDE "SampleAgent.RSRC" 'code' as 'code';
  22.  
  23. // some defines for portions of object ids
  24.  
  25. #define        kNameRsrcID        3000
  26. #define        kDescRsrcID        3001
  27. #define        SAMPLE            kOID_ISO, kOID_ORG, kOID_DOD, kOID_INTERNET, kOID_PRIVAT, kOID_ENTERPRISES, kOID_APPLE, kOID_APPL_EXPERIMENTAL, 1
  28. #define        DIRECT            SAMPLE, 1        
  29. #define        INDIRECT        SAMPLE, 2        
  30.  
  31.  
  32. //--------------------------------------------------------------------------------------------------
  33. // Variable Description resource 
  34. //--------------------------------------------------------------------------------------------------
  35.  
  36. resource 'vard' (128, "Sample Agent Variable Description Resource", purgeable)
  37. {
  38.     kNameRsrcID,        // name strings resource id
  39.     kDescRsrcID,        // description strings resource id
  40.     1,                    // agents name and desc string index
  41.     
  42.     // string index and object ids of all groups to be registered
  43.     {
  44.         2, {DIRECT},        // direct group
  45.         3, {INDIRECT},        // indirect group
  46.     },
  47.     
  48.     // string index, ASN type, access, callback proc index, and object id for all
  49.     // variables
  50.     
  51.     {
  52.         4, kSNMP_Integer, kSNMP_ReadWrite, 0, 0, 0, {INDIRECT, 1},                                // IndIntRW
  53.         5, kSNMP_Integer, kSNMP_ReadOnly, 0, 1, 0, {INDIRECT, 2},                                // IndIntR
  54.         6, kSNMP_SequenceOF, kSNMP_NoAccess, 0, 2, 0, {INDIRECT, 3},                            // Table1
  55.         7, kSNMP_Integer | kSNMP_TableElement, kSNMP_ReadWrite, 0, 3, 0, {INDIRECT, 3, 1, 1},        // T1Int
  56.         8, kSNMP_OctetStr | kSNMP_TableElement, kSNMP_ReadWrite, 0, 4, 0, {INDIRECT, 3, 1, 2},    // T1Str
  57.         9, kSNMP_SequenceOF, kSNMP_NoAccess, 0, 5, 0, {INDIRECT, 4}    ,                            // Table2
  58.         10, kSNMP_Integer | kSNMP_TableElement, kSNMP_ReadWrite, 0, 6, 0, {INDIRECT, 4, 1, 1},        // T2Index1
  59.         11, kSNMP_Integer | kSNMP_TableElement, kSNMP_ReadWrite, 0, 7, 0, {INDIRECT, 4, 1, 2},        // T2Index2
  60.         12, kSNMP_OctetStr | kSNMP_TableElement, kSNMP_ReadWrite, 0, 8, 0, {INDIRECT, 4, 1, 3},    // T2Str
  61.         13, kSNMP_Integer | kSNMP_TableElement, kSNMP_ReadWrite, 0, 9, 0, {INDIRECT, 4, 1, 4},        // T2Valid
  62.         14, kSNMP_Integer, kSNMP_ReadWrite, 4, 0, 1, {DIRECT, 1}                                    // DirInt
  63.     }
  64. };
  65.     
  66. //--------------------------------------------------------------------------------------------------
  67. //    Name strings
  68. //    
  69. //    The indexes for each name string must match the indexes given in the 'vard' resource above.
  70. //--------------------------------------------------------------------------------------------------
  71.  
  72. resource 'STR#' (kNameRsrcID, "Sample Agent Name strings", purgeable)
  73. {
  74.     {    
  75.         /* [1] */ "Mac Sample Agent",
  76.         /* [2] */ "Direct Group",
  77.         /* [3] */ "Indirect Group",
  78.         /* [4] */ "indIntRW",
  79.         /* [5] */ "indIntR",
  80.         /* [6] */ "table1",
  81.         /* [7] */ "t1Int",
  82.         /* [8] */ "t1Str",
  83.         /* [9] */ "table2",
  84.         /* [10] */ "t2Index1",
  85.         /* [11] */ "t2Index2",
  86.         /* [12] */ "t2Str",
  87.         /* [13] */ "t2Valid",
  88.         /* [14] */ "dirIntRW"        
  89.     }
  90. };    
  91.  
  92.  
  93. //--------------------------------------------------------------------------------------------------
  94. //    Description strings
  95. //
  96. //    The indexes for the strings here must match the indexes given in the 'vard' resource above.
  97. //--------------------------------------------------------------------------------------------------
  98.  
  99. resource 'STR#' (kDescRsrcID, "Sample Agent Description strings", purgeable)
  100. {
  101.     {    
  102.         /* [1] */
  103.         "Sample Agent.  This agent is provided for use as an example of how to "
  104.         "build an SNMP agent.",
  105.         /* [2] */
  106.         "The direct group.  This group contains the variables which were registered "
  107.         "as direct variables - i.e. the variable object accesses the variable data "
  108.         "directly through a pointer.",
  109.         /* [3] */
  110.         "The Indirect Group.  This group contains the variables which were registered "
  111.         "as indirect variables - i.e. the variable object accesses the variable data "
  112.         "indirectly through a function in the agent.",
  113.         /* [4] */
  114.         "An indirect read/write integer. An indirect variable is one in which the variable "
  115.         "object accesses the variable data indirectly through a function in the agent.",
  116.         /* [5] */
  117.         "An Indirect read-only integer. An indirect variable is one in which the variable "
  118.         "object accesses the variable data indirectly through a function in the agent.",
  119.         /* [6] */
  120.         "A table consisting of 2 columns, an integer and a string.  Rows are added or deleted "
  121.         "by setting the integer column.",
  122.         /* [7] */
  123.         "The integer column of table1. This column is used to add and delete rows. Setting a "
  124.         "value of zero deletes the row, and setting a value from 1 to 999 adds the row. A "
  125.         "value greater than 999 is invalid.",
  126.         /* [8] */
  127.         "The String column of table 1. A value must be set in this column when adding a row "
  128.         "to the table.",
  129.         /* [9] */
  130.         "A two index table in which the indexes are columns in the table.  The valid column "
  131.         "is used to create and delete rows.",
  132.         /* [10] */
  133.         "The first Index column of table 2. The value can range from 1 to 10.",
  134.         /* [11] */
  135.         "The second Index column of table 2. The value can range from 1 to 10.",
  136.         /* [12] */
  137.         "The string column of table 2. If not set when adding a row, a null string will be "
  138.         "set by default.",
  139.         /* [13] */
  140.         "The valid column of table 2. Setting it to zero deletes the row, and setting it "
  141.         "to non-zero adds the row.",
  142.         /* [14] */
  143.         "A Direct Read/Write integer. A direct variable is one in which the variable object "
  144.         "accesses the variable data directly."
  145.     }
  146. };